import Vue from 'vue'
import App from './App'

import config from './utils/common.js'
//引入vuex
import store from './utils/store'

import preventReClick from './utils/stopprev.js' //防多次点击，重复提交

Vue.prototype.$noMultipleClicks = preventReClick.noMultipleClicks;

//把vuex定义成全局组件
Vue.prototype.$store = store

Vue.prototype.config = config;
Vue.prototype.URL = config.URL;

Vue.config.productionTip = false




App.mpType = 'app'

import uView from "uview-ui";
Vue.use(uView);

const app = new Vue({
    ...App,
		store
})
app.$mount()

Vue.filter('dateFormat', function(originVal) {
  const dt = new Date(originVal)

  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  const d = (dt.getDate() + '').padStart(2, '0')

  const hh = (dt.getHours() + '').padStart(2, '0')
  const mm = (dt.getMinutes() + '').padStart(2, '0')
  const ss = (dt.getSeconds() + '').padStart(2, '0')

  return `${y}`
})
